package com.ruoyi.jwyz.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jwyz.mapper.ActivityMapper;
import com.ruoyi.jwyz.domain.Activity;
import com.ruoyi.jwyz.service.IActivityService;

/**
 * 约会Service业务层处理
 * 
 * @author lxp
 * @date 2023-03-31
 */
@Service
public class ActivityServiceImpl extends ServiceImpl<ActivityMapper,Activity> implements IActivityService
{
    @Autowired
    private ActivityMapper activityMapper;

    /**
     * 查询约会
     * 
     * @param id 约会主键
     * @return 约会
     */
    @Override
    public Activity selectActivityById(Long id)
    {
        return activityMapper.selectActivityById(id);
    }

    /**
     * 查询约会列表
     * 
     * @param activity 约会
     * @return 约会
     */
    @Override
    public List<Activity> selectActivityList(Activity activity)
    {
        return activityMapper.selectActivityList(activity);
    }

    /**
     * 新增约会
     * 
     * @param activity 约会
     * @return 结果
     */
    @Override
    public int insertActivity(Activity activity)
    {
        activity.setCreateTime(DateUtils.getNowDate());
        return activityMapper.insertActivity(activity);
    }

    /**
     * 修改约会
     * 
     * @param activity 约会
     * @return 结果
     */
    @Override
    public int updateActivity(Activity activity)
    {
        activity.setUpdateTime(DateUtils.getNowDate());
        return activityMapper.updateActivity(activity);
    }

    /**
     * 批量删除约会
     * 
     * @param ids 需要删除的约会主键
     * @return 结果
     */
    @Override
    public int deleteActivityByIds(Long[] ids)
    {
        return activityMapper.deleteActivityByIds(ids);
    }

    /**
     * 删除约会信息
     * 
     * @param id 约会主键
     * @return 结果
     */
    @Override
    public int deleteActivityById(Long id)
    {
        return activityMapper.deleteActivityById(id);
    }
}
